const dayjs = require("dayjs");
const db = require('../../middleware/db');
const Sequelize = require('sequelize');
module.exports = db.define('inf_info', {

title:{
comment:'标题3',
type: Sequelize.STRING(50),  
allowNull: false,
defaultValue: ''

},

contents:{
comment:'内容',
type: Sequelize.TEXT(), 
allowNull: false,
defaultValue: ''

},

info_type_id:{
comment:'栏目id',
type: Sequelize.STRING(50),  
allowNull: false,
defaultValue: ''

},

sort:{
comment:'排序',
type: Sequelize.INTEGER(11),  
allowNull: false,
defaultValue: '0'
},

release_date:{
comment:'发布时间',
type: Sequelize.DATE(), 
allowNull: false,
defaultValue: Sequelize.literal("CURRENT_TIMESTAMP"),
get() { return dayjs(this.getDataValue("release_date")).format("YYYY-MM-DD HH:mm:ss");}
},

});